<?php
namespace Home\Model;

use Think\Model\RelationModel;

class MeetingRoomsModel extends RelationModel
{
    protected $_link = [
        'user' => [
            'mapping_type' => self::BELONGS_TO,   //关联类型
            'foreign_key' => 'user_id',    //外键
            'class_name' => 'User',      //要关联的模型类名
            'mapping_fields' => [     //关联的映射名称，用于获取数据用
                'nickname' => 'author_name',  //姓名
                'face' => 'author_avatar'    //头像
            ]
        ]
    ];

}
